package com.cloud.server.system;

import com.cloud.common.core.annotation.EnableAuthExceptionHandler;
import com.cloud.common.core.annotation.EnableOauth2FeignClient;
import com.cloud.common.core.annotation.EnableServerProtect;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @Description:
 * @Auther: zhangxun
 * @Date: 2020/8/6 14:14
 */
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
//排除jdbc自动装配的另一种方式：
// spring:
//   autoconfigure:
//     exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
@EnableDiscoveryClient
@EnableGlobalMethodSecurity(prePostEnabled = true)  //开启Spring Cloud Security权限注解
@EnableFeignClients //开启Feign Client功能
@EnableAuthExceptionHandler   //自定义注解，使用@Enable模块驱动的方式加载自定义的类到Spring IOC容器中
@EnableOauth2FeignClient
//上面这两个注解合为下面这个了
//@CloudApplication
@MapperScan("com.cloud.server.system.mapper")
@EnableTransactionManagement
@EnableServerProtect
public class SystemApplication {
    public static void main(String[] args) {
        SpringApplication.run(SystemApplication.class,args);
    }
}